/**
 * 
 */
package com.ywm8.ywm.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.ywm8.ywm.admin.dao.BaseDao;
import com.ywm8.ywm.admin.service.BaseService;

/**
 * @author wangruishun
 * @version ywm8 1.0 2014-1-8 下午6:20:52
 */

@SuppressWarnings("rawtypes")
public class BaseServiceImpl<T> implements BaseService<T> {

	
	private BaseDao dao;


	@Resource
	public void setDao(BaseDao dao) {
		this.dao = dao;
	}

	public void saveEntity(T t) {
		dao.saveEntity(t);
	}

	
	public void updateEntity(T t) {
		dao.updateEntity(t);
	}

	public void deleteEntity(T t) {
		dao.deleteEntity(t);
	}

	public void saveOrUpdateEntity(T t) {
		dao.saveOrUpdateEntity(t);
	}

	public void batchEntityByHQL(String hql, Object... objects) {
		dao.batchEntityByHQL(hql, objects);
	}

	public T getEntity(Integer id) {
		return (T) dao.getEntity(id);
	}

	public T loadEntity(Integer id) {

		return (T) dao.loadEntity(id);
	}

	public List<T> findEntityByHQL(String hql, Object... objects) {

		return dao.findEntityByHQL(hql, objects);
	}

}
